package com.example.sandbox.dto.Enum;

public enum Order58payStatus {


    PENDING((byte) 1, "PENDING"),
    SUCCESS((byte) 2, "SUCCESS"),
    FAIL((byte) 3, "FAIL"),
    REFUND((byte) 4, "REFUND");

    private final byte key;
    private final String value;

    Order58payStatus(byte key, String value) {
        this.key = key;
        this.value = value;
    }

    public byte getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByKey(byte key) {
        for (Order58payStatus status : Order58payStatus.values()) {
            if (status.getKey() == key) {
                return status.getValue();
            }
        }
        return null; // 或者抛出异常，根据需要
    }

}
